package com.wetao.lib_common.utils;

import java.util.LinkedList;
import java.util.List;


/**
 * author: zhouyh
 * created on: 2021/6/7 11:43 上午
 * description:
 */
public class ForMulaHelper {

    private StringBuffer sb = new StringBuffer();

    private List<StringBuffer> tempDataList = new LinkedList<>();

    public void append(String content) {
        if(tempDataList.isEmpty()){
            sb.append(content);
        }else{
            tempDataList.get(tempDataList.size()-1).append(content);
        }
    }

    public void addTempData(){
        tempDataList.add(new StringBuffer());
    }

    public String getTempData(){
        String data = tempDataList.get(tempDataList.size()-1 ).toString();
        tempDataList.remove(tempDataList.size()-1);
        return data;
    }


    private boolean inText = false;

    public boolean isInText() {
        return inText;
    }

    public void setInText(boolean inText) {
        this.inText = inText;
    }

    public StringBuffer getSb() {
        return sb;
    }
}
